<?php header("content-Type: text/html; charset=UTF-8");
date_default_timezone_set("PRC");
?>
<script type='text/javascript'>
	function ChangeImg(obj1, obj2)
	{
		if(obj2 == '1')
  			obj1.src = "Images/btn_ok2.JPG"
		if(obj2 == '2')
  			obj1.src = "Images/btn_ok.JPG"
	}
</script>
<?php

if( isset($_REQUEST['userid']))
	$user_id = $_REQUEST['userid'];
else
	$user_id = "";
	
	if( isset($_REQUEST['tid']))
		$st_id = $_REQUEST['tid'];
	else
		$st_id = "";
	if(isset($g_pay_type) == false)
			$g_pay_type= "";

//获取信息的指令
if( isset($_REQUEST['md']))
	$md=$_REQUEST['md'];
else
	$md="";	
	
	$order_time =date("Y-m-d H:i:s",time());
	$order_date =date("Y-m-d",time());

	//api class file
	include('../api/include.php');
	//包含数据库连接文件  
	include('../api/conn.php');  

	if($md != "")
	{
				$user_sql = "exec p_get_chongzhi_xinxi ?,?";  
			  $params = array();
				$params[0] = $user_id;
				$params[1] = $md;
				$result=sqlsrv_query($conn,$user_sql,$params);
		
				if(empty($result))
				{
						exit(' 遇到数据库错误！请点击此处 <a href="javascript:history.back(-1);">返回</a> 重试');  
				}		
		
				echo "<div style='margin-top:100px;margin-left:200px;'> <image src='Images/bbfly.png'> </div>";

				while($row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC))
				{
					$strTypeID	= $row['t_type'];
					$strBank 		= iconv("gb2312", "utf-8", $row['t_yinhang']);
					$strName 		= iconv("gb2312", "utf-8", $row['t_kaihuren']);
					$strAccount = iconv("gb2312", "utf-8", $row['t_zhanghao'] );
					$ReMark 		= iconv("gb2312", "utf-8", $row['t_czRemark'] );
					$strWeb			= $row['t_web'];
					
					$strPayType="0";
					if(strstr($strBank, "微信"))
							$strPayType="1";
					if(strstr($strBank, "支付宝"))
							$strPayType="2";
					if(strstr($strBank, "QQ"))
							$strPayType="3";
					if(strstr($strBank, "在线"))	
							$strPayType="4";
					echo "<br><div style='margin-top:10px;margin-left:200px;'> <a href='$strWeb?userid=$user_id&paytype=$strPayType&tid=$strTypeID' target='_blank'> <image id='imgok' name='imgok' src='Images/btn_ok.jpg' onmouseenter=\"ChangeImg(this, 1);\" onmouseout=\"ChangeImg(this, 2)\">   </a>  </div>";

					echo "<br><div style='width:450px;align:left;margin-top:20px;margin-left:150px'> ";
					echo "<image  src='Images/kuang.png' width='450px'>";
//					echo "开户银行：" . $strBank . "<br>";
//					echo "开户姓名：" . $strName . "<br>";
//					echo "开户账号：" . $strAccount . "<br><br><br>";
					echo "<span style='margin-left:10px;margin-top:-98px;font-size:14px;display:block;'> <font name='宋体' color='#df6b02'>";
					echo "操作说明<br>";
					echo 		$ReMark;
					echo "</font> </span></div>";
				}
		
			//带 MD参数的，到这里就结束了。
			exit();
	}
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>会员中心-第三方支付</title>
    

<script type="text/javascript">
 	var ctx="";
 	var offsettime = '-14400000';
 	var current = parseInt('1535649586755',10) || 0;
 	var MEMBER_DIR="ogmember";
 	var OG_MEMBER_DIR="ogmember";
</script>

    <link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon">
    <script type="text/javascript" src="./js/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="./js/data.cn.js"></script>
    <script type="text/javascript" src="./js/common.js"></script>
    <script type="text/javascript" src="./js/jquery.blockUI.min.js"></script>
    <script type="text/javascript" src="./js/WdatePicker.js"></script>
    <script type="text/javascript" src="./js/object.js"></script>
    <script type="text/javascript" src="./js/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="./js/bootstrap.min.js"></script>
    
    
    <link href="./css/WdatePicker.css" rel="stylesheet" type="text/css">
 		<link href="./css/Main.css" rel="stylesheet">
		<link href="./css/cz.css" rel="stylesheet">
		<link href="./css/style.css" rel="stylesheet">
    
    <script type="text/javascript">
				var isPc = 'True'
				
        $(document).ready(function () {
            var d = new Date();
            var years = d.getFullYear();
            var month = add_zero(d.getMonth() + 1);
            var days = add_zero(d.getDate());
            var hours = add_zero(d.getHours());
            var minutes = add_zero(d.getMinutes());
            var seconds = add_zero(d.getSeconds());

            dispTime()

            var timerID = setInterval("dispTime()", 1000);
            var url = "";
        });

        function add_zero(temp) {
            if (temp < 10) return "0" + temp;
            else return temp;
        }
        /**
         *    即時時間顯示
         **/
        function dispTime() {
            var d = new Date();
            var utc = d.getTime() + (d.getTimezoneOffset() * 60000);

            var F = new Date( utc + (3600000 * -4 ));

            var Y = F.getFullYear();

            var Mh = F.getMonth() + 1;
            if(Mh > 12) Mh = 01;
            if(Mh < 10) Mh = '0'+Mh;

            var D = F.getDate()  < 10 ? '0'+F.getDate():F.getDate();
            var H = F.getHours() < 10 ? '0'+F.getHours():F.getHours();
            var M = F.getMinutes() < 10 ? '0'+F.getMinutes():F.getMinutes();
            var S = F.getSeconds() < 10 ? '0'+F.getSeconds():F.getSeconds();
            $('#EST_reciprocal').html(Y+'/'+Mh+'/'+D+' - '+H+':'+M+':'+S);
        }
     //客户端是否PC？   
    function IsPC() {
	    var userAgentInfo = navigator.userAgent;
	    var Agents = ["Android", "iPhone",
	                "SymbianOS", "Windows Phone",
	                "iPad", "iPod"];
	    var flag = true;
	    for (var v = 0; v < Agents.length; v++) {
	        if (userAgentInfo.indexOf(Agents[v]) > 0) {
	            flag = false;
	            break;
	        }
	    }
	    return flag;
		}
		//手机端功能    
    function useMobileFun() {
        $(".cz_nav").hide()
        $("head").append('<meta name="viewport" content="width=device-width, initial-scale=1,  user-scalable=no" />');
        $("head").append('<link href="css/czmobile.css" rel="stylesheet" />')
    }
    //切换支付方式
    function	changePayType(payType, strDesc)
    {
    	if(payType == '0')
    	{
   			document.getElementById("cz_bg_div").className="cz_nav bg";
   			onlineBankPay('<?php echo $user_id ?>', '在线网银支付', '网银支付接口');
    	}
		if(payType == '1')
    	{
   			document.getElementById("cz_bg_div").className="cz_nav bg2";
   			qrcodeBank('1','qrcodePay','2','微信支付');		
    	}
		if(payType == '2')
    	{
   			document.getElementById("cz_bg_div").className="cz_nav bg3";
   			qrcodeBank('2','qrcodePay','5','支付宝');		
    	}
		if(payType == '3')
    	{
   			document.getElementById("cz_bg_div").className="cz_nav bg4";
   			qrcodeBank('3','qrcodePay','4','QQ扫码支付');		
    	}	
		if(payType == '4')
    	{
   			document.getElementById("cz_bg_div").className="cz_nav bg5";
   			qrcodeBank('4','qrcodePay','4','云闪付');		
    	}	
    		//change the input interface....

    		
    }  
    </script>

<style>
	body{
	padding:0;  /*去除内边距*/
  border:0;   /*去除边框*/
  margin:0;   /*去除外边距*/
	text-align:left;
	margin-left:0px;
	margin-right:auto;
	/*max-width:1024px;*/
	}
	
	.clearfix:after {content: ".";display: block;clear: both;visibility: hidden;line-height: 0;height: 0;}
	.clearfix {display: inline-block}
	.payico{
		position: relative;
		top: 5px;
		left: -2px;
	}
	#Dcard {
		font-size: 13px;
		position: absolute;
		right: 280px;
		top:218px;
	}
	a.pagelink {
		color: #004892;
		font-weight: bold;
		text-decoration: underline;
	}
	.span table td{
		line-height: 1.5em;
		color: #666;
		padding: 6px 8px;
	}
	.span table td img{
		max-width:95%;
	}
	.span table {
		width: 100%;
		border-collapse: collapse;
		border-spacing: 0;
		text-align: left;
		font-size: 12px;
		color: #FFF;
	}
	.column, .columns{
		width:100%;
	}

	#DepositMethod {
		height: auto !important;
		min-height: 200px;
		width: 100%;
		margin-top: -30px;
	}
	#DepositMethod h1 {
		border-bottom: medium none;
		font-size: 26px;
		/* margin-top: 20px; */
		padding: 0;
		text-align: center;
	}
	#DepositMethod li img {
		border: 3px solid #e1e1e0;
		height: 59px;
		background: white;
		width: 132px;
	}
	#DepositMethod li.active img{
		border-color: #696866;
	}
	.selected-payment-logo {
		border-color: #696866 !important;
	}
	#DepositMethod li {
		display: inline;
		float: left;
		margin-bottom: 13px;
		margin-right: 10px;
	}
	#DepositMethod {
		height: auto !important;
		min-height: 200px;
		width: 100%;
	}
	#cashierdeposit-logo-container{
		margin-left: -22px;
	}
/*	#cashierdeposit-logo-container > ul{
		width: 770px;
		margin-left: -35px;
		margin-top: 8px;
	}*/
	/*
   存款页面
*/
	#accountInfo{
		margin-left: 14px;
	}
	#accountInfo .info-txt{
		font-weight:bold;
		margin-bottom: 4px;
	}
	#accountInfo p{
		height: 24px;
		line-height: 24px;
		display: block;
	}
	#accountInfo p.info{
		margin-left: 40px;
	}
	#depositContent{
		width: 99%;
		margin-left: 1px;
		margin-bottom:10px;
		min-height: 402px;
		position: relative;
		top: 3px;
	}
	#titleTab{
		height: 40px;
		margin-top: 15px;
		width: 99%;
		margin-left: -41px;
	}
	#titleTabC{
		margin: 0 auto;
		/* background: #C05045; */
		width: 130px;
		line-height: 36px;
		text-align: center;
		font-size: 23px;
		/* border: 2px solid black; */
		height: 36px;
	}
	.listh1{
		background: #FFFFFF;
		color: #f66f15;
		max-width: 162px;
		width: auto;
		cursor: pointer;
		height: 36px;
		line-height: 36px;
		font-size: 18px;
		border-radius: 22px;
		margin-top: 10px;
		padding: 0 6px 0 20px;
		box-shadow: 1px 3px 0 #ccc;
		min-width: 50px;
		text-align: left;
	}
	.listh1:hover{
		box-shadow: none;
	}
	#showlist{
		width: 98%;
		margin: 10px auto;
	}
	.showlist{
		width: 98%;
		margin: 10px auto;
	}
	#_content{
		width: 100%;
		min-height: 400px;
	}

</style>


</head>
<!--
      style="overflow-y: hidden "
			//payType:1=微信；2=支付宝；3=QQ；4=银联；5=京东;6=微信H5，7=支付宝H5

-->

<body>
	<div id="cz_header">
    <div class="cz_header">
        <div class="cz_logo"></div>
        <div id="cz_bg_div" class="cz_nav" style="display:none">
            <ul class="clearfix">
                <li><a href="javascript:void(0); changePayType(0, '在线充值')">在线充值</a></li>
                <li><a href="javascript:void(0); changePayType(1, '支付宝')">支付宝充值</a></li>
                <li><a href="javascript:void(0); changePayType(2, '微信')">微信充值</a></li>
                <li><a href="javascript:void(0); changePayType(3, 'QQ充值')">QQ充值</a></li>
            </ul>
        </div>
    </div>
</div>

<div class="cztd-wrap">
    <ul class="cztd" id="childNav">
       
    </ul>
</div>

<input type="hidden" id="isCheckTestMember" name="isCheckTestMember" value="1">

<input type="hidden" id="payType" name="payType" value="0">
<input type="hidden" id="payBank" name="payBank" value="">

<div id="wrap" style="position: relative;">
    <div class="top">
        <div id="MALogo"></div>
        <div id="MATime">
            <div id="timepic"></div>
            	<!--	
            		<span class="time">美东时间：<span id="EST_reciprocal">2018/08/30 - 13:24:03</span></span>
            	-->
        </div>
        <div id="MABank"> </div>
    </div>
    <!-- //* Body -->
    <div id="MAContent" class="main_mem clear_fix">
        <div class="account-bg">
            <div class="ulList">


                <div class="ulList_bt"></div>
            </div>
        </div>
        <!--右边区域 -->
        <div class="account-right">
            <div id="mamain">
                <div id="MACenter-content">









<div id="mmaindata">

	<div class="l-balance-transfer">
		<div class="cashierWrapper" style="width: 100%;">
			<div class="row-fluid">
				
			<!--
				在线支付 html 跳转页面
			-->

		<div style="border: 1px solid #ddd; margin-top: 2px; margin-left:5px;margin-right:8px;">

			<!--  this is IFrame page-->
			<div id="depositContent">
	


			</div>
		</div>
		
		
		<div id="tbl-history_info" class="dataTables_info"></div>
		<div id="tbl-history_paginate" class="dataTables_paginate paging_full_numbers history-pagination">
			<a id="tbl-history_first" class="first paginate_button paginate_button_disabled" tabindex="0" style="display: none;">First</a> <a id="tbl-history_previous" class="previous paginate_button paginate_button_disabled arrow" tabindex="0" style="display: none;">Prev</a> <span></span> <a id="tbl-history_next" class="next paginate_button paginate_button_disabled arrow" tabindex="0" style="display: none;">下一步</a> <a id="tbl-history_last" class="last paginate_button paginate_button_disabled" tabindex="0" style="display: none;">Last</a>
		</div>
	</div>
</div></div>
                <div class="clear"></div>
            </div>
        </div>

    </div>
		<div></div>
    <div id="MAFoot">Copyright © Reserved</div>
</div>



<?php  
	
	
	function	ShowDiv($divName, $isShow)
	{
		if($isShow == "1")
			echo "<script type='text/javascript'> document.getElementById('$divName').style.display='block'; </script>";
		else
			echo "<script type='text/javascript'> document.getElementById('$divName').style.display='none'; </script>";
	
	}
	
	//show pay infomation
	function 	ShowPayInfo($aa, $bb, $cc, $dd, $tid, &$pay_type)
	{
//		echo $aa.$bb.$cc;
//		class='cur'				//selected...

	if( isset($_REQUEST['tid']))
		$st_id = $_REQUEST['tid'];
	else
		$st_id = "";
		

			if($tid == $st_id)
			{
				$pay_type=$dd;
				echo "<script type='text/javascript'> document.getElementById('childNav').innerHTML += \"<li class='cur'> <a href='$cc&paytype=$dd&tid=$tid'>	<img src='$bb'><p>$aa</p> </a>	</li>\" </script>";
			}
			else
				echo "<script type='text/javascript'> document.getElementById('childNav').innerHTML += \"<li> <a href='$cc&paytype=$dd&tid=$tid'>	<img src='$bb'><p>$aa</p> </a>	</li>\" </script>";
										
	}
	
	
	if(1)
	{
			//执行数据库脚本：第一个横向的支付方式的开关
		$user_sql = "exec p_get_chongzhi_xinxi ?,?";  
	  $params = array();
		$params[0] = $user_id;
		$params[1] = 0;
		$result=sqlsrv_query($conn,$user_sql,$params);

		if(empty($result))
		{
				exit(' 遇到数据库错误！请点击此处 <a href="javascript:history.back(-1);">返回</a> 重试');  
		}
	

		while($row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC))
		{
			$a_id			 = $row['t_type'];
			$a_yinhang = iconv("gb2312", "utf-8", $row['t_yinhang'] );
			$a_url		 = $row['t_web'] . '?userid=' . $user_id;

			$img_name="";
			$tmp_pay_type='';
			if(strstr($a_yinhang, "支付宝") )
			{
					$img_name="Images/paybtn3.PNG";	
					$tmp_pay_type='2';
			}
			else	if(strstr($a_yinhang, "微信"))
			{
					$img_name="Images/WEIXINWAP.png";	
					$tmp_pay_type='1';
			}
			else if(strstr($a_yinhang, "QQ"))
			{
					$img_name="Images/QQWAP.png";	
					$tmp_pay_type='3';
			}
			else if(strstr($a_yinhang, "银行"))
			{
					$img_name="Images/bank.png";	
					$tmp_pay_type='4';		
			}
			else
			{
					$img_name="Images/paybtn0.png";	
					$tmp_pay_type='0';		
			}
			ShowPayInfo($a_yinhang, $img_name, $a_url, $tmp_pay_type, $a_id, $g_pay_type);
		}
	
	}

?>



</body>



<script type="text/javascript">

	//获取IFRAME的document
	function getIFrameDOM(iID)
	{
		return document.getElementById(iID).contentWindow.document;
	}
	
	//IFRAME加在完毕。
	function	ifreamLoad()
	{
		getIFrameDOM("_content").getElementById('user_id').innerHTML = '<?php echo $user_id ?>';
		getIFrameDOM("_content").getElementById('payType').value = document.getElementById('payType').value;
		getIFrameDOM("_content").getElementById('payBank').value = document.getElementById('payBank').value;
	}
		//onlinepay各种支付方式
		//obj1:1=微信；2=支付宝；3=QQ；4=银联；5=京东;6=微信H5，7=支付宝H5
		function	qrcodeBank(obj1, obj2, obj3, obj4)
		{
				var tick = "?time="+new Date().getTime();
				document.getElementById('depositContent').innerHTML = '<iframe id=\"_content\" onload=\"ifreamLoad()\" frameborder=\"0\" src=\"input_id_amount.html' + tick +'\"></iframe>';
				document.getElementById('payType').value  = obj1;
				document.getElementById('payBank').value  = obj4;
		}
		
		//在线网银支付
		function	onlineBankPay(uid, title, desc)
		{
				var tick = "?time="+new Date().getTime();
				document.getElementById('depositContent').innerHTML = '<iframe id=\"_content\" onload=\"ifreamLoad()\" frameborder=\"0\" src=\"input_id_amount.html'+ tick +'\"></iframe>';
				document.getElementById('payType').value  = "0";
				document.getElementById('payBank').value  = "bank";
		}

	//鼠标消息
	function	controlBelow(obj)
	{
	
	}
	function	controlBelowout(obj)
	{
	
	}
		
		
    //遮罩背景色
    QSFUN.SetOptions('maskColor', '#333');
    QSFUN.SetOptions('blockId', '#wrap');
    var param;
    if ('0' != "0") {

        param = $.parseJSON('0');
    }
//    QSFUN.MChgPager({method: "bankSavings"}, param);

 
    $(".ulList a").click(function () {

        if ($(this).parent().attr('id') == 'sidebar-mem' || $(this).parent().attr('id') == 'sidebar-msg') {
            return false;
        }
        if (!$(this).hasClass('current')) {
            $(".ulList a").removeClass('current');
            $(this).addClass('current');
        }

    });
    function mover(o) {
        o.style.backgroundPosition = '0 bottom';
    }

    function mout(o) {
        o.style.backgroundPosition = '0 top';
    }

    function cancelMouse() {
        return false;
    }
//    document.oncontextmenu = cancelMouse;
    
    var vpaytype = '<?php echo $g_pay_type ?>';
    if(vpaytype == '0')
    {
    	changePayType('4', '在线充值');
	}
    else
    {
    	changePayType(vpaytype, '在线充值');
		document.getElementById('depositContent').style="display:block;";
	}
		isPc = false;
      if (isPc != true) 
      {
          useMobileFun();
			if(vpaytype == '')
				document.getElementById('depositContent').style="display:none;";

      }
      if(IsPC())
      {
      	
      }
//      else
//      	document.getElementById("childNav").style="display:none;";
      	
</script>

</html>